Module search - #7
Conversation
There was a problem hiding this comment.
Not sure what those 3 lines are for.
you probably meant:
$i-spacing: 12px !default;
and then use $i-spacing / 2 and $i-spacing * 2
There was a problem hiding this comment.
Why $i-spacing? I wanna use the variable for the padding in the input field and use it for the space between input field and icon. For me these are "general" spaces. Because of that I choosed a general variable. And added the variables on top that you know which thinks you need to define.
But I could add
$s: $s;
$s-half: 0.5 * $s;
$s-double: 2 * $s;
If I change the variable in the settings it should change it everywhere in all modules. If I write
$i-spacing: 12px !default;
it doesn't.
There was a problem hiding this comment.
@lejoe If you have in the settings.scss this:
$i-spacing: $s;
and then in style.scss this:
$i-spacing: 12px !default;
You will overwrite the style definition from the settings. If you change then the variable $s in the settings it would not change in the module. Because in style.scss you will have 12px !default.
I wanted to avoid this.
And I still don't understand why the variable name should be $i-spacing? i for icon? it's not a icon space.
There was a problem hiding this comment.
You will overwrite the style definition from the settings. If you change then the variable $s in the settings it would not change in the module. Because in style.scss you will have 12px !default.
Have you tried it? it will not because of the !default.
You can read about it here: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variable_defaults_
$i-spacing is better because what if suddenly you want something else that the regular spacing for the icons?
There was a problem hiding this comment.
ohh... I didn't know that. Thats awesome! :)
ok, I agree having a new variable allows you having another space that the regular spacing. But usually I don't wanna have another space. The advantage of having a general variable (and multiple of this variable) is that you have a good overview over all spaces you are using in the project. and if you need another size you can just add i.e $s-third.
My problem is to understand when should I add a new variable and when not.
$i-spacing is used to define the space inside the input field (maybe the name means input-spacing and not icon-spacing)
but then you will use the same variable for the module form?
There was a problem hiding this comment.
My problem is to understand when should I add a new variable and when not.
The rule of thumb is that if you want it really modular, each modules should use their own variables that you initialise in the settings file. That's the ideal world. Sometimes for simplicity and time reasons we don't do that and use "global" variables in modules like $c- or $l-gap- …
$i-spacing is used to define the space inside the input field (maybe the name means input-spacing and not icon-spacing)
Right it should be input spacing or even search-spacing.
but then you will use the same variable for the module form?
which module form?
There was a problem hiding this comment.
There is no form module in this project. But if there would be a module form (i.e. to get in touch). There we need also an input-spacing. And I was wondering, if we would use then $i-spacing too (even there are two different modules)
@lejoe I didn't add the glass as a button. I think it would be the best having the search by typing.
closes #3